<!--
			URL/show/:title
			app/views/resumes/show.html.erb
			The show resume view - shows a particular resume of the user in full
			controller: resumes, action: show 

			Documentation:
			- data within <p></p> is presented with linebreaks by the script
-->

<link rel="stylesheet" type="text/css" href="/stylesheets/resume_common.css" />
<link rel="stylesheet" type="text/css" href="/stylesheets/resumes/show.css" />	

<div class="heading">
	<h3> <%=h @user.username %> : <%=h @resume.title %>  </h3>
	<div class="links">
		<%= link_to 'quick-edit', '/edit2/'+@resume.title %> 
		<%= link_to 'print', '/show_p/'+@resume.title %> 
	</div>	
</div>

<% form_tag('', :method => "post") do %>	<!-- for authenticity token -->
<div class="outer_container">	<!-- to set the width and margins -->
<div class="container" id="resumeId_<%=h @resume.id %>">

	<div class="resume_meta_desc">
		<%=h @resume.meta_desc %>
	</div>

	<div class="tab_bar">
		<span class="tab_button" id="resume_parts.tab_button">
			resume parts
		</span>
		<span class="tab_button" id="other_settings.tab_button">
			template-public_status-default-delete
		</span>
	</div>
	
	<div class="tab_item" id="resume_parts">
	<table class="parts_table">
	
		<tr id="username">
			<td class="column1"><%= link_to 'Name', '/show/'+@resume.title %></td>
			<td class="column2">
				<span class="inactive">enter</span>
			</td>
			<td class="column3">
				<span class="inactive">edit</span>
			</td>
			<td class="column4">
				<span class="inactive">add</span>
			<td class="column5">
				<span class="inactive">delete</span>
		</tr>
		
		<tr id="contacts">
			<% exist = (@resume.contact) ? true :  false %>
			<td class="column1"><%= link_to 'Contact', '/show/'+@resume.title+'/contacts' %></td>
			<td class="column2">
				<% if !exist %>	<span class="active"><%= link_to 'enter', '/new/'+@resume.title+'/contacts' %></span>
				<% else %>		<span class="inactive">enter</span>
				<% end %>
			</td>
			<td class="column3">
				<% if exist %>	<span class="active"><%= link_to 'edit', '/edit/'+@resume.title+'/contacts' %></span>
				<% else %>		<span class="inactive">edit</span>
				<% end %>
			</td>
			<td class="column4">
				<span class="inactive">add</span>
			</td>
			<td class="column5">
				<% if exist %>	<span class="active"><button type="button">delete</button><%#= link_to 'delete', '/destroy/'+@resume.title+'/contacts', :confirm => 'sure?', :method => :delete %></span>
				<% else %>		<span class="inactive">delete</span>
				<% end %>
			</td>
		</tr>
		
		<tr id="profiles">
			<% exist = (@resume.profile) ? true :  false %>
			<td class="column1"><%= link_to 'Profile', '/show/'+@resume.title+'/profiles' %></td>
			<td class="column2">
				<% if !exist %>	<span class="active"><%= link_to 'enter', '/new/'+@resume.title+'/profiles' %></span>
				<% else %>		<span class="inactive">enter</span>
				<% end %>
			</td>	
			<td class="column3">
				<% if exist %>	<span class="active"><%= link_to 'edit', '/edit/'+@resume.title+'/profiles' %></span>
				<% else %>		<span class="inactive">edit</span>
				<% end %>
			</td>
			<td class="column4">
				<span class="inactive">add</span>
			</td>
			<td class="column5">
				<% if exist %>	<span class="active"><button type="button">delete</button><%#= link_to 'delete', '/destroy/'+@resume.title+'/profiles', :confirm => 'sure?', :method => :delete %></span>
				<% else %>		<span class="inactive">delete</span>
				<% end %>
			</td>
		</tr>
		
		<tr id="skills">
			<% exist = (@resume.skills.size !=0) ? true : false %>
			<td class="column1"><%= link_to 'Skills', '/show/'+@resume.title+'/skills' %></td>
			<td class="column2">
				<% if !exist %>	<span class="active"><%= link_to 'enter', '/new/'+@resume.title+'/skills' %></span>
				<% else %>		<span class="inactive">enter</span>
				<% end %>
			</td>	
			<td class="column3">
				<% if exist %>	<span class="active"><%= link_to 'edit', '/edit/'+@resume.title+'/skills' %></span>
				<% else %>		<span class="inactive">edit</span>
				<% end %>
			</td>
			<td class="column4">
				<% if exist %>	<span class="active"><%= link_to 'add', '/new/'+@resume.title+'/skills' %></span>
				<% else %>		<span class="inactive">add</span>
				<% end %>
			</td>
			<td class="column5">
				<% if exist %>	<span class="active"><button type="button">delete</button><%#= link_to 'delete', '/destroyall/'+@resume.title+'/skills', :confirm => 'sure?', :method => :delete %></span>
				<% else %>		<span class="inactive">delete</span>
				<% end %>
			</td>
		</tr>
		
		<tr id="educations">
			<% exist = (@resume.educations.size !=0) ? true :  false %>
			<td class="column1"><%= link_to 'Education', '/show/'+@resume.title+'/educations' %></td>
			<td class="column2">
				<% if !exist %>	<span class="active"><%= link_to 'enter', '/new/'+@resume.title+'/educations' %></span>
				<% else %>		<span class="inactive">enter</span>
				<% end %>
			</td>	
			<td class="column3">
				<% if exist %>	<span class="active"><%= link_to 'edit', '/edit/'+@resume.title+'/educations' %></span>
				<% else %>		<span class="inactive">edit</span>
				<% end %>
			</td>
			<td class="column4">
				<% if exist %>	<span class="active"><%= link_to 'add', '/new/'+@resume.title+'/educations' %></span>
				<% else %>		<span class="inactive">add</span>
				<% end %>
			</td>
			<td class="column5">
				<% if exist %>	<span class="active"><button type="button">delete</button><%#= link_to 'delete', '/destroyall/'+@resume.title+'/educations', :confirm => 'sure?', :method => :delete %></span>
				<% else %>		<span class="inactive">delete</span>
				<% end %>
			</td>
		</tr>
		
		<tr id="experiences">
			<% exist = (@resume.experiences.size !=0) ? true :  false %>
			<td class="column1"><%= link_to 'Experience', '/show/'+@resume.title+'/experiences' %></td>
			<td class="column2">
				<% if !exist %>	<span class="active"><%= link_to 'enter', '/new/'+@resume.title+'/experiences' %></span>
				<% else %>		<span class="inactive">enter</span>
				<% end %>
			</td>	
			<td class="column3">
				<% if exist %>	<span class="active"><%= link_to 'edit', '/edit/'+@resume.title+'/experiences' %></span>
				<% else %>		<span class="inactive">edit</span>
				<% end %>
			</td>
			<td class="column4">
				<% if exist %>	<span class="active"><%= link_to 'add', '/new/'+@resume.title+'/experiences' %></span>
				<% else %>		<span class="inactive">add</span>
				<% end %>
			</td>
			<td class="column5">
				<% if exist %>	<span class="active"><button type="button">delete</button><%#= link_to 'delete', '/destroyall/'+@resume.title+'/experiences', :confirm => 'sure?', :method => :delete %></span>
				<% else %>		<span class="inactive">delete</span>
				<% end %>
			</td>
		</tr>
		
		<tr id="achievements">
			<% exist = @resume.achievement ? true :  false %>
			<td class="column1"><%= link_to 'Achievements', '/show/'+@resume.title+'/achievements' %></td>
			<td class="column2">
				<% if !exist %>	<span class="active"><%= link_to 'enter', '/new/'+@resume.title+'/achievements' %></span>
				<% else %>		<span class="inactive">enter</span>
				<% end %>
			</td>	
			<td class="column3">
				<% if exist %>	<span class="active"><%= link_to 'edit', '/edit/'+@resume.title+'/achievements' %></span>
				<% else %>		<span class="inactive">edit</span>
				<% end %>
			</td>
			<td class="column4">
				<span class="inactive">add</span>
			</td>
			<td class="column5">
				<% if exist %>	<span class="active"><button type="button">delete</button><%#= link_to 'delete', '/destroy/'+@resume.title+'/achievements', :confirm => 'sure?', :method => :delete %></span>
				<% else %>		<span class="inactive">delete</span>
				<% end %>
			</td>		
		</tr>
		
		<tr id="hobbies">
			<% exist = @resume.hobby ? true :  false %>
			<td class="column1"><%= link_to 'Hobbies', '/show/'+@resume.title+'/hobbies' %></td>
			<td class="column2">
				<% if !exist %>	<span class="active"><%= link_to 'enter', '/new/'+@resume.title+'/hobbies' %></span>
				<% else %>		<span class="inactive">enter</span>
				<% end %>
			</td>	
			<td class="column3">
				<% if exist %>	<span class="active"><%= link_to 'edit', '/edit/'+@resume.title+'/hobbies' %></span>
				<% else %>		<span class="inactive">edit</span>
				<% end %>
			</td>
			<td class="column4">
				<span class="inactive">add</span>
			</td>
			<td class="column5">
				<% if exist %>	<span class="active"><button type="button">delete</button><%#= link_to 'delete', '/destroy/'+@resume.title+'/hobbies', :confirm => 'sure?', :method => :delete %></span>
				<% else %>		<span class="inactive">delete</span>
				<% end %>
			</td>	
		</tr>		
	</table> 	<!-- parts_table -->
	</div>
	
	<div class="tab_item" id="other_settings">
	
		<div class="setting_div" id="resume_template">
			<h4>Template </h4>
			<span class="template_name"><%=h @rtemplate.name %></span>
			<span class="setting_action"><%= link_to 'change', '/change/'+@resume.title+'/rtemplates' %></span>
		</div>

		<div class="setting_div"  id="public_status">
			<h4>Public status</h4>
			<span class="public_status_text"><%=h @resume.public_status %></span>
			<button class="setting_action" type="button">change</button>
		</div>

		<div class="setting_div"  id="default_status">
			<h4>Default ?</h4>
			<% default = (@resume.id==@user.default_resume)? true : false %>
			<div class="default_status_text <%= default ? "" : "hidden" %>" >This is the default resume </div>
			<div class="default_status_text <%= default ? "hidden" : "" %>">		
				<span>Current default is <%= link_to @default_resume.title, '/show/'+@default_resume.title %></span>
				<button class="setting_action" type="button">Set this one as default</button>
			</div>	
		</div>
		
		<div class="setting_div"  id="delete_resume">
			<h4>Destroy ?</h4>	
			<span class="delete_resume_text">All the data will be lost. </span>
			<button class="setting_action" type="button">Delete this resume</button>
		</div>

	</div>
	

	
</div> 	<!-- container -->
</div>	<!-- outer container -->
<% end # form %>
 
<script type="text/javascript" src="/javascripts/jquery-1.3.2.js"></script>
<script type="text/javascript" src="/javascripts/resume_common.js"></script>
<script type="text/javascript" src="/javascripts/resumes/show.js"></script>